<template>
	<view class="empower">
		<view class='header'>
			<view class="logo-img">
				<open-data type="userAvatarUrl" style="width: 100%;height: 100%;display: inline-block;"></open-data>
			</view>
		</view>
		<view class='content'>
			<view>申请获取以下权限</view>
			<text>获得你的公开信息(昵称，头像、地区等)</text>
		</view>
		<button class='bottom' type='primary' open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="wxGetUserInfo">
			授权登录
		</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			wxGetUserInfo(res) {
				this.$emit('wxGetUserInfo', res)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.empower {
		width: 100vw;
		display: flex;
		justify-content: center;
		flex-direction: column;
		margin-top: 200upx;
		.header {
			padding: 90rpx 0 40rpx 50rpx;
			text-align: center;
			width: 650rpx;
			height: 300rpx;
			font-size: 0upx;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.header .logo-img {
			width: 200rpx;
			height: 200rpx;
			border-radius: 50%;
			overflow: hidden;
			display: block;
			vertical-align: middle;
		}

		.content {
			margin-left: 50rpx;
			margin-bottom: 90rpx;
			display: flex;
			flex-direction: column;
		}

		.content text {
			display: block;
			color: #9d9d9d;
			margin-top: 40rpx;
		}

		.bottom {
			width: 683upx;
			height: 81upx;
			background: #42BD56;
			border-radius: 8upx;
			font-size: 29upx;
			font-family: SimHei;
			font-weight: 400;
			color: rgba(62, 58, 57, 1);
			line-height: 81upx;
			text-align: center;
			margin: 0upx auto;
		}

		button {
			background-color: transparent;
			border-radius: 0rpx;
			padding: 0rpx;
			margin: 0rpx;
			line-height: 1;
			overflow: visible;
			color: rgba(78, 101, 101, 1);
		}

		button::after {
			/*button的边框样式是通过::after方式实现的*/
			border: none;
		}

		.button-hover {
			/*点击后样式*/
			color: #000;
		}
	}
</style>
